package com.cdm.persistence;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import net.sf.commons.data.validator.ValidateDate;
import net.sf.commons.data.validator.ValidateNumber;
import net.sf.commons.data.validator.ValidateString;
import net.sf.frails.bean.annotations.DefValidator;
import net.sf.frails.bean.validator.BeanValidator;
import net.sf.frails.bean.validator.Field;
import net.sf.frails.bean.validator.ValidateBean;

/**
 * @author Cain
 * 
 */
@DefValidator(id = "contentValidator")
@BeanValidator(name = "contentValidator", targetType = Content.class, fields = {
        @Field(name = "contentName", required = true, validateString = @ValidateString(maxLen = 1000, validatorMessage = "必须填写名称", message = "错误")),
        @Field(name = "contentLength", required = false, validateNumber = @ValidateNumber(validatorMessage = "长度必须为数字")),
//        @Field(name = "actor", required = false, validateString = @ValidateString(maxLen = 500, validatorMessage = "error.age.range", message = "error.age")),
//        @Field(name = "director", required = false, validateString = @ValidateString(maxLen = 100, validatorMessage = "error.age.range", message = "error.age")),
//        @Field(name = "productor", required = false, validateString = @ValidateString(maxLen = 100, validatorMessage = "error.age.range", message = "error.age")),
        //@Field(name = "limitTime", required = false, validateDate = @ValidateDate(validatorMessage = "error.age.range", message = "error.age")),
        @Field(name = "description", required = false, validateString = @ValidateString(maxLen = 65535, validatorMessage = "error.age.range", message = "error.age")) })
public class ContentValidator {

}
